package com.test.jdk;

/**
 * Created by houjinxin on 16/9/26.
 */
public class JavaVMStackOOM{

    private void dontStop(){
        while(true){

        }

    }

    public void stackLeakByThread(){

        while(true){

            Thread t = new Thread(new Runnable(){

                public void run(){
                    dontStop();
                }
            });
            t.start();
        }
    }
    public static void main(String[] args){
        JavaVMStackOOM oom = new JavaVMStackOOM();
        oom. stackLeakByThread();
    }
}